package com.ruoyi.common.workflow.listener.handler;

import com.ruoyi.common.core.utils.SpringUtils;
import com.ruoyi.common.workflow.listener.FlowBeforeHandler;
import com.ruoyi.common.workflow.service.IWorkflowService;
import com.ruoyi.common.workflow.service.impl.WorkflowServiceImpl;
import com.ruoyi.workflow.api.domain.vo.TaskModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * @description: 测试
 * @author: gssong
 * @date: 2022-06-26
 */
@Component
public class TestBeforeBean implements FlowBeforeHandler {
    private static final Logger logger = LoggerFactory.getLogger(TestBeforeBean.class);

    @Override
    public void handleProcess(String processInstanceId, String taskId) {
        IWorkflowService workflowService = SpringUtils.getBean(WorkflowServiceImpl.class);
        TaskModel task = workflowService.getCurrentTask(taskId);
        logger.info("taskName:"+task.getName());
    }
}
